package com.tarry.cxf.service.impl;

import com.google.common.collect.Lists;
import com.tarry.cxf.entity.Student;
import com.tarry.cxf.service.IStudentService;
import org.springframework.stereotype.Service;

import javax.jws.WebService;
import java.util.ArrayList;
import java.util.List;

@Service
@WebService(serviceName = "studentService"//服务名
        ,targetNamespace = "http://service.cxf.tarry.com/" //包倒叙，并且和接口定义保持一致
        ,endpointInterface = "com.tarry.cxf.service.IStudentService")//包名
public class StudentServiceImpl implements IStudentService {

    @Override
    public List<Student> getStudentInfo() {
        List<Student> students = Lists.newArrayList();
        Student student = buildStudent(30,100,"Tarry");
        students.add(student);
        return students;
    }


    private Student buildStudent(Integer age,Integer score,String name){
        Student student = new Student(age, score, name);
        return student;
    }
}
